// ES6
var arr = [1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3]
var newArr = Array.from(new Set(arr))
console.log(newArr);
// indexOf
var newArr = []
for (var i = 0; i < arr.length; i++) {
  if (newArr.indexOf(arr[i]) == -1) {
    newArr.push(arr[i])
  }
}
console.log(newArr);